<?php
 
namespace models\entities;
 
/**
 * @Entity(repositoryClass="models\repositories\UserRepository")
 * @Table(name="user")
 */
class User {
 
/**
 * @Id
 * @Column(name="user_id",type="string", length=45, unique=true, nullable=false)
 */
	protected $userId;
 
/**
 * @Column(type="string", length=45, nullable=false)
 */
	protected $password;
	
/**
 * @Column(name="nama", type="string", length=50, nullable=false)
 */
	protected $name;
	
/**
 * @Column(name="mail", type="string", length=50, nullable=false)
 */
	protected $mail;


/**
 * @Column(name="status", type="integer", length=1, nullable=false)
 */
	protected $status;
	
	
/**
 * @Column(name="create_date", type="datetime", nullable=true)
 */
	protected $createDate;
 
/**
 * @Column(name="last_login", type="integer", nullable=true)
 */
	protected $lastLogin;
	
/**
 * 
 * @ManyToOne(targetEntity="Jabatan", fetch="EAGER")
 * @JoinColumn(name="jabatan_id", referencedColumnName="kode")
 */
	protected $jabatan;	 
 
/**
 * @Column(name="msisdn", type="integer", length=16, nullable=false)
 */
	protected $msisdn;
	
	public function setUserId($userId)
	{
	    $this->userId = $userId;
	}
 
	public function getUserId()
	{
	    return $this->userId;
	}

	public function setPassword($password)
	{
	    $this->password = $password;
	}
 
	public function getPassword()
	{
	    return $this->password;
	}
	
	public function setTimestamp($timestamp)
    {
        // will NOT be saved in the database
        $this->timestamp = new \DateTime("now");
    }
    
	public function getTimestamp()
    {
        return $timestamp;
    }
	
	public function setCreateDate($createDate)
	{
	    $this->createDate = $createDate;
	}
 
	public function getCreateDate()
	{
	    return $this->createDate;
	}
	
	public function setLastLogin($lastLogin)
	{
	    $this->lastLogin = $lastLogin;
	}
 
	public function getLastLogin()
	{
	    return $this->lastLogin;
	}	
	
	public function setJabatan($jabatna){
		$this->jabatan = $jabatna;
	}
	
	public function getJabatan(){
		return $this->jabatan;
	}
	//Add Name, Mail, And Status On Entities
	public function setName($name)
	{
	    $this->name = $name;
	}
 
	public function getName()
	{
	    return $this->name;
	}
	
	public function setMail($mail)
	{
	    $this->mail = $mail;
	}
 
	public function getMail()
	{
	    return $this->mail;
	}
	
	public function setStatus($status)
	{
	    $this->status = $status;
	}
 
	public function getStatus()
	{
	    return $this->status;
	}
	
	public function setMsisdn($msisdn)
	{
	    $this->msisdn = $msisdn;
	}
 
	public function getMsisdn()
	{
	    return $this->msisdn;
	}
}